window.appModule.factory('knowledgeAPI',factoryFn);

function factoryFn($resource){
    var actions = {
        getQuestionBasesByUserId: {
            url: ENV['API_URL']+'/openfaqserver/getQuestionBasesByUserId.action',
            method: 'post'
        },
        getQuestionBaseById: {
            url: ENV['API_URL']+'/openfaqserver/getQuestionBaseById.action',
            method: 'post'
        },
        addQuestionBase: {
            url: ENV['API_URL']+'/openfaqserver/addQuestionBase.action',
            method: 'post'
        },
        updateQuestionBase: {
            url: ENV['API_URL']+'/openfaqserver/updateQuestionBase.action',
            method: 'post'
        },
        deleteQuestionBase: {
            url: ENV['API_URL']+'/openfaqserver/deleteQuestionBase.action',
            method: 'post'
        },
        getUserRelativeRobots: {
            url: ENV['API_URL']+'/openfaqserver/getUserRelativeRobots.action',
            method: 'post'
        },
        getUserById: {
            url: ENV['API_URL']+'/openfaqserver/getUserById.action',
            method: 'post'
        },
        getMenusByUserId: {
            url: ENV['API_URL']+'/openfaqserver/getMenusByUserId.action',
            method: 'post'
        },
        logOut: {
            url: ENV['API_URL']+'/openfaqserver/logOut.action',
            method: 'post'
        }
    };
    return $resource('', {_ajaxWrapOption: {}},actions);
};